#include<bits/stdc++.h>

using namespace std;

int main() {
    char s[100];
    cin >> s;
    for (char *p = s; *p; p++) {
        if (!isalpha(*p))continue;
        if (isupper(*p)) {
            *p = tolower(*p);
            continue;
        }
        if (islower(*p))*p = toupper(*p);
    }
    cout << s << endl;
    return 0;
}
